a=10
b=3
print(f"{a}+{b}={a+b}")
print(f"{a}-{b}={a-b}")
print(f"{a}*{b}={a*b}")
print(f"{a}/{b}={a/b:.2f}")


x=5
y=8



print(f"{x}>{y}吗?{x>y}")
print(f"{x}=={y}吗?{x==y}")
print(f"{x}!={y}吗?{x!=y}")

password="abc123"
user_input=input("请输入密码:")
print("密码正确!" if user_input == password else "密码错误!")


age=18
has_license=True
print(f"可以开车吗? {age >=18 and has_license}")


is_weekend=False
is_holiday=True
print(f"今天休息吗? {is_weekend or is_holiday}")


is_raining = False
print(f"需要带伞吗   {not is_raining}")


num1 = float(input("请输入第一个数字:"))
num2 = float(input("请输入第二个数字:"))
operator = input("请输入运算符(+-*/):")


if  operator == "+":
    print(f"结果:{num1 + num2}")
elif operator == "-":
    print(f"结果:{num1 - num2}")
elif operator == "*":
    print(f"结果:{num1 * num2}")
elif operator == "/":
    print(f"结果: {num1 / num2 if num2 != 0 else '错误:除数不能为0'}")
else:
    print("无效运算符")

length = int(input("密码长度:"))
use_special = input("使用特殊字符?(y/n):").lower() == "y"

import random
chars = "abcdfeghjklmnoprstuvwxyz0123456789"
if use_special:
    chars += "!@#$%^&*"


password = ''.join(random.choice(chars) for _ in range(length))
print(f"生成密码: \033[36m{password}\033[0m")

